#!/bin/bash


DIST=$1
GoSum=0
AsmSum=0


for i in `ls $DIST`
do
	P=$DIST/$i
	if test -d $P ;then
		g=`find $P -name "*.go" | xargs cat | grep -v ^$ | wc -l`
		a=`find $P -name "*.s" | xargs cat | grep -v ^$ | wc -l`
		echo "$P:.go :$g"
		echo "$P:.s  :$a"
		let GoSum+=$g
		let AsmSum+=$a
	fi
done

echo "$DIST:.go : $GoSum"
echo "$DIST:.s  : $AsmSum"

echo ""
echo ""
echo ""
echo "the content in $DIST"

ls $DIST -l | awk '{print $9}' | egrep -v 'amd|386|arm|ppc64|s390|plan9|windows|bsd|solaris|darwin|dragonfly|_stub|test|android|unix'


let GoSum+=`find $DIST -name "*.go" | xargs cat | grep -v ^$ | wc -l`
let AsmSum+=`find $DIST -name "*.s" | xargs cat | grep -v ^$ | wc -l`

echo "$DIST:.go : $GoSum"
echo "$DIST:.s  : $AsmSum"

let t=$GoSum+$AsmSum
echo "total line : $t" 



